<template>
	<div>
		<Banner :poster="poster" />

		<Detil :filmInfo="filmInfo" :typeName="typeName" />

		<SpwierOne :actors="actors" />
		<Spwier :photos="photos" />
		<Footer />
	</div>
</template>

<script>
import axios from 'axios'
import Banner from './DetilChild/Detil_banner.vue'
import Footer from './DetilChild/Detil_footer.vue'
import Detil from './DetilChild/Detil.vue'
import SpwierOne from './DetilChild/Detil_spwierOne.vue'
import Spwier from './DetilChild/Detil_spwierTwo.vue'
export default {
	name: 'Index',
	data() {
		return {
			filmInfo: [],
			photos: [],
			poster: '',
			actors: [],
			typeName: '',
		}
	},
	components: {
		Banner,
		Footer,
		Detil,
		SpwierOne,
		Spwier,
	},
	mounted() {
		//隐藏tabbar
		this.$store.commit('hider')

		axios({
			url: `/api/gateway?filmId=${this.$route.params.id}&k=1605171`,
			method: 'get',
			headers: {
				'X-Client-Info':
					'{"a":"3000","ch":"1002","v":"5.2.0","e":"16176183882578247392952321","bc":"110100"}',
				'X-Host': 'mall.film-ticket.film.info',
			},
		}).then((res) => {
			console.log(res.data.data.film, 123)
			this.filmInfo = res.data.data.film
			this.poster = res.data.data.film.poster
			this.photos = res.data.data.film.photos
			this.actors = res.data.data.film.actors
			this.typeName = res.data.data.film.filmType.name
		})
	},
	beforeDestroy() {
		//离开显示tabbar组件
		this.$store.commit('show')
	},
}
</script>

<style></style>
